-- GENERATED SPELL FOR [Illidari Battle-mage] --


function spell0_23402(pUnit, Event) --@Blizzard,n/a--
pUnit:FullCastSpellOnTarget(41382,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23402', 8000, 1)
end

function spell1_23402(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(41383,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23402', 644, 1)
end

function spell2_23402(pUnit, Event) --@Flamestrike,n/a--
pUnit:FullCastSpellOnTarget(41379,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23402', 10000, 1)
end

function spell3_23402(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(41384,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23402', 2325, 1)
end

function Sorts_23402(pUnit, Event)
local choix_sorts_23402 = math.random(0, 3)
if choix_sorts_23402 == 0 then
pUnit:RegisterEvent('spell0_23402', 1, 1)
end
if choix_sorts_23402 == 1 then
pUnit:RegisterEvent('spell1_23402', 1, 1)
end
if choix_sorts_23402 == 2 then
pUnit:RegisterEvent('spell2_23402', 1, 1)
end
if choix_sorts_23402 == 3 then
pUnit:RegisterEvent('spell3_23402', 1, 1)
end
end

function mob23402_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_23402', math.random(1500, 3000), 1)
end

function mob23402_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23402_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23402_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(23402, 1, 'mob23402_Action')
RegisterUnitEvent(23402, 2, 'mob23402_Leave')
RegisterUnitEvent(23402, 3, 'mob23402_Kill')
RegisterUnitEvent(23402, 4, 'mob23402_Die')
